package com.feige.netty;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 在springboot启动完成之后做一些事情
 * @author feige
 */
@Component
public class MyCommandLineRunner implements CommandLineRunner {
    @Resource
    private NettyServer nettyServer;


    /**
     * 启动netty服务
     * @param args
     * @throws Exception
     */
    @Override
    public void run(String... args) throws Exception {
        nettyServer.start();
    }
}
